package com.hpf.tool.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.codehaus.jackson.annotate.JsonIgnore;
/**
 * 
 * @author hpf
 *
 */
public class SearchEntity extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2282780541293751689L;

	/**
	 * 查询是否加锁
	 */
	@JsonIgnore
	private boolean lock;

	/**
	 * 查询是否校验结果
	 */
	private boolean verifyNull;

	/**
	 * 排序参数
	 */
	private SortEntity sort;

	/**
	 * 查询 key
	 */
	private String key;
	/**
	 * 查询 value
	 */
	private String value;

	/**
	 * 查询 开始日期
	 */
	private Date beginDate;
	/**
	 * 查询 结束日期
	 */
	private Date endDate;

	private List<SortEntity> sortList;
	@JsonIgnore
	private List<OrderType> orderList;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public boolean isLock() {
		return lock;
	}

	public void setLock(boolean lock) {
		this.lock = lock;
	}

	/**
	 * @return the sortList
	 */
	public List<SortEntity> getSortList() {
		return sortList;
	}

	/**
	 * @param sortList
	 *            the sortList to set
	 */
	public void setSortList(List<SortEntity> sortList) {
		this.sortList = sortList;
	}

	/**
	 * 添加排序
	 * 
	 * @param sort
	 */
	public void addSort(SortEntity sort) {
		if (null == this.sortList) {
			this.sortList = new ArrayList<SortEntity>();
		}
		this.sortList.add(sort);
	}

	/**
	 * @return the orderList
	 */
	public List<OrderType> getOrderList() {
		return orderList;
	}

	/**
	 * @param orderList
	 *            the orderList to set
	 */
	public void setOrderList(List<OrderType> orderList) {
		this.orderList = orderList;
	}

	/**
	 * @return the sort
	 */
	public SortEntity getSort() {
		return sort;
	}

	/**
	 * @param sort
	 *            the sort to set
	 */
	public void setSort(SortEntity sort) {
		this.sort = sort;
	}

	/**
	 * @return the verifyNull
	 */
	public boolean isVerifyNull() {
		return verifyNull;
	}

	/**
	 * @param verifyNull
	 *            the verifyNull to set
	 */
	public void setVerifyNull(boolean verifyNull) {
		this.verifyNull = verifyNull;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
}
